package com.sofun.ai.controller;

import dev.langchain4j.model.ollama.OllamaChatModel;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController()
@RequestMapping("/ollama")
public class OllamaController {

    @Resource
    private OllamaChatModel ollamaChatModel;

    @RequestMapping(value = "/deekseek_chat")
    public String chat(@RequestParam(name = "message", defaultValue = "Hello, how are you?") String message ){
        return ollamaChatModel.chat(message);
    }
}
